Skip to main content

std.data

Pebble 0.3.1 · all symbols on this page are stable.

Helpers for converting between data and the Pebble-level string type. For converting other types to and from data, use the built-in ToData interface (.toData() method) and the destructors in std.builtins.

Methods

FunctionDescription
strToData(s: string): dataEncode a UTF-8 string as data (via encodeUtf8 and then bData).
strFromData(d: data): stringDecode data containing UTF-8 bytes back to a string. Fails on bad input.

See also

  • data — the type itself
  • std.builtinsconstrData, mapData, listData, iData, bData and their destructors
  • ToData — the auto-implemented interface every encodable type satisfies